load("@rules_python//python:defs.bzl", "py_test")
load("//bazel:canisters.bzl", "finalize_wasm")

# Test subject
finalize_wasm(
    name = "stamped_trivial",
    testonly = True,
    service_file = "service.did",
    src_wasm = "trivial.wasm",
    version_file = "//bazel:version.txt",
)

# Inspects test subject.
py_test(
    name = "inspect_stamped_trivial_wasm",
    srcs = ["inspect_stamped_trivial_wasm.py"],
    data = [
        ":stamped_trivial",
        "//bazel:version.txt",
        "@crate_index//:ic-wasm__ic-wasm",
    ],
    env = {
        "IC_WASM_PATH": "$(location @crate_index//:ic-wasm__ic-wasm)",
        "STAMPED_WASM_PATH": "$(location :stamped_trivial)",
        "VERSION_TXT_PATH": "$(location //bazel:version.txt)",
    },
)
